<template>
  <div class="grandson">
    <h2>我是Grandson</h2>
    <h4>我的牛奶：{{milk}}</h4>
    <button @click="handleClick">把牛奶给Child1</button>
  </div>
</template>

<script>
  export default {
    name:'Grandson',
    data() {
      return {
        milk:'伊利'
      }
    },
    methods: {
      handleClick(){
        this.$bus.$emit('get-milk',this.milk)
      }
    },
  }
</script>

<style scoped>
  .grandson {
    margin-top: 10px;
    background-color: rgb(8, 203, 8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>